extends Control

var dlg_msg=[]

var now_index = 0

func _ready():
	$RPGDialog.role_name = "凌波丽"
	dlg_msg=[
		"大家好，我是[color=red]凌波丽[/color]",
		"这是我的RPG对话框项目",
		"在这里我将演示如何使用此元件"
	]
	
	$RPGDialog.show()
	$RPGDialog.text = dlg_msg[0]

func show_dlg_text():
	if now_index <dlg_msg.size()-1:
		now_index += 1
		$RPGDialog.text = dlg_msg[now_index]
	elif now_index == dlg_msg.size()-1:
		now_index = 0
		$RPGDialog.hide()

func show_dlg_text_last():
	if now_index >0:
		now_index -= 1
		$RPGDialog.text = dlg_msg[now_index]

func _on_RPGDialog_click():
	show_dlg_text()
	pass # Replace with function body.


func _on_RPGDialog_last_clicked():
	show_dlg_text_last()
	pass # Replace with function body.


func _on_RPGDialog_next_clicked():
	show_dlg_text()
	pass # Replace with function body.


func _on_RPGDialog_skip_clicked():
	$RPGDialog.hide()
	now_index = 0
	pass # Replace with function body.
